<template>
  <view>
    <view class="wenBy">
      <textarea v-model="msg.content" class="jianYi" name="jianyi" id="" cols="30" rows="10" placeholder="请填写"></textarea>
    </view>
    <button class="submit" @click="sub">提交</button>
  </view>
</template>

<script>
  import { SubSuggest } from '../../request/api'
  export default {
    data() {
      return {
        msg: {
          content: '',
          users_id: uni.getStorageSync('userInfo').id
        }
      }
    },
    methods: {
      sub(){
        // console.log(this.msg)
        SubSuggest(this.msg).then((res) => {
          // console.log(res)
          uni.showToast({
            icon: 'success',
            title: '提交成功'
          })
        }).catch((err) => {
          console.log(err)
        })
        setTimeout(() => {
          uni.switchTab({
            url: '/pages/my/my'
          })
        },800)
      }
    }
  }
</script>

<style>
  .jianYi {
    margin: 30rpx auto;
    padding: 20rpx;
    border: 1rpx solid #d6d6d6;
    border-radius: 14rpx;
    box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.5);
  }
  .submit{
    width: 90%;
    border-radius: 100rpx;
    background: #1067d1;
    color: #fff;
    margin-top: 100rpx;
  }
</style>